.class public Lcom/android/inputmethod/latin/KeyboardSwitcher;
.super Ljava/lang/Object;
.source "KeyboardSwitcher.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;
    }
.end annotation


# static fields
.field private static final ALPHABET_MODES:[I = null

.field public static final KEYBOARDMODE_EMAIL:I = 0x7f0b0012

.field public static final KEYBOARDMODE_IM:I = 0x7f0b0013

.field public static final KEYBOARDMODE_IM_NO_VOICE:I = 0x7f0b0014

.field public static final KEYBOARDMODE_NORMAL:I = 0x7f0b000f

.field public static final KEYBOARDMODE_NORMAL_NO_VOICE:I = 0x7f0b0010

.field public static final KEYBOARDMODE_URL:I = 0x7f0b0011

.field public static final MODE_EMAIL:I = 0x5

.field public static final MODE_IM:I = 0x6

.field public static final MODE_PHONE:I = 0x3

.field public static final MODE_SYMBOLS:I = 0x2

.field public static final MODE_TEXT:I = 0x1

.field public static final MODE_TEXT_ALPHA:I = 0x1

.field public static final MODE_TEXT_COUNT:I = 0x2

.field public static final MODE_TEXT_QWERTY:I = 0x0

.field public static final MODE_URL:I = 0x4

.field private static final SYMBOLS_MODE_STATE_BEGIN:I = 0x1

.field private static final SYMBOLS_MODE_STATE_NONE:I = 0x0

.field private static final SYMBOLS_MODE_STATE_SYMBOL:I = 0x2


# instance fields
.field mContext:Landroid/content/Context;

.field private mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

.field private mEnableMultipleLanguages:Z

.field private mImeOptions:I

.field private mInputLocale:Ljava/util/Locale;

.field mInputMethodService:Landroid/inputmethodservice/InputMethodService;

.field mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

.field private mIsSupportVoiceInput:Z

.field private mIsSymbols:Z

.field private mKeyboards:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;",
            "Lcom/android/inputmethod/latin/LatinKeyboard;",
            ">;"
        }
    .end annotation
.end field

.field private mLanguageSwitcher:Lcom/android/inputmethod/latin/LanguageSwitcher;

.field private mLastDisplayWidth:I

.field private mMode:I

.field private mPreferSymbols:Z

.field private mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

.field private mSymbolsModeState:I

.field private mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

.field private mTextMode:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 53
    const/4 v0, 0x6

    new-array v0, v0, [I

    fill-array-data v0, :array_0

    sput-object v0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->ALPHABET_MODES:[I

    return-void

    nop

    :array_0
    .array-data 0x4
        0xft 0x0t 0xbt 0x7ft
        0x11t 0x0t 0xbt 0x7ft
        0x12t 0x0t 0xbt 0x7ft
        0x13t 0x0t 0xbt 0x7ft
        0x10t 0x0t 0xbt 0x7ft
        0x14t 0x0t 0xbt 0x7ft
    .end array-data
.end method

.method constructor <init>(Landroid/content/Context;Landroid/inputmethodservice/InputMethodService;)V
    .locals 2
    .parameter "context"
    .parameter "ims"

    .prologue
    const/4 v0, 0x0

    .line 84
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 73
    iput v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mTextMode:I

    .line 76
    iput v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    .line 77
    iput-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    .line 85
    iput-object p1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    .line 86
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    .line 87
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f040007

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    iput-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 88
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f040008

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    iput-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 89
    iput-object p2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputMethodService:Landroid/inputmethodservice/InputMethodService;

    .line 90
    return-void
.end method

.method private getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;
    .locals 8
    .parameter "id"

    .prologue
    const/4 v7, 0x0

    .line 189
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    invoke-interface {v4, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_2

    .line 190
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    .line 191
    .local v2, orig:Landroid/content/res/Resources;
    invoke-virtual {v2}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    .line 192
    .local v0, conf:Landroid/content/res/Configuration;
    iget-object v3, v0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

    .line 193
    .local v3, saveLocale:Ljava/util/Locale;
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputLocale:Ljava/util/Locale;

    iput-object v4, v0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

    .line 194
    invoke-virtual {v2, v0, v7}, Landroid/content/res/Resources;->updateConfiguration(Landroid/content/res/Configuration;Landroid/util/DisplayMetrics;)V

    .line 195
    new-instance v1, Lcom/android/inputmethod/latin/LatinKeyboard;

    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    iget v5, p1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->mXml:I

    iget v6, p1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->mKeyboardMode:I

    invoke-direct {v1, v4, v5, v6}, Lcom/android/inputmethod/latin/LatinKeyboard;-><init>(Landroid/content/Context;II)V

    .line 197
    .local v1, keyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLanguageSwitcher:Lcom/android/inputmethod/latin/LanguageSwitcher;

    invoke-virtual {v1, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setLanguageSwitcher(Lcom/android/inputmethod/latin/LanguageSwitcher;)V

    .line 198
    iget v4, p1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->mKeyboardMode:I

    invoke-direct {p0, v4}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->isAlphabetMode(I)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 199
    const v4, 0x7f040002

    invoke-virtual {v1, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setExtension(I)V

    .line 202
    :cond_0
    iget-boolean v4, p1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->mEnableShiftLock:Z

    if-eqz v4, :cond_1

    .line 203
    invoke-virtual {v1}, Lcom/android/inputmethod/latin/LatinKeyboard;->enableShiftLock()V

    .line 205
    :cond_1
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    invoke-interface {v4, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 206
    iput-object v3, v0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

    .line 207
    invoke-virtual {v2, v0, v7}, Landroid/content/res/Resources;->updateConfiguration(Landroid/content/res/Configuration;Landroid/util/DisplayMetrics;)V

    .line 209
    .end local v0           #conf:Landroid/content/res/Configuration;
    .end local v1           #keyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    .end local v2           #orig:Landroid/content/res/Resources;
    .end local v3           #saveLocale:Ljava/util/Locale;
    :cond_2
    iget-object v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    invoke-interface {v4, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/android/inputmethod/latin/LatinKeyboard;

    return-object p0
.end method

.method private getKeyboardId(IIZ)Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;
    .locals 5
    .parameter "mode"
    .parameter "imeOptions"
    .parameter "isSymbols"

    .prologue
    const v4, 0x7f0b000f

    const v1, 0x7f040007

    const v3, 0x7f040006

    const/4 v2, 0x1

    .line 213
    if-eqz p3, :cond_1

    .line 214
    const/4 v0, 0x3

    if-ne p1, v0, :cond_0

    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f040004

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    .line 245
    :goto_0
    return-object v0

    .line 214
    :cond_0
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    goto :goto_0

    .line 218
    :cond_1
    packed-switch p1, :pswitch_data_0

    .line 245
    :cond_2
    const/4 v0, 0x0

    goto :goto_0

    .line 220
    :pswitch_0
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mTextMode:I

    if-nez v0, :cond_4

    .line 221
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    if-eqz v0, :cond_3

    .line 222
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {v0, v3, v4, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 224
    :cond_3
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f0b0010

    invoke-direct {v0, v3, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 226
    :cond_4
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mTextMode:I

    if-ne v0, v2, :cond_2

    .line 227
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f040001

    invoke-direct {v0, v1, v4, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 231
    :pswitch_1
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    goto :goto_0

    .line 233
    :pswitch_2
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f040003

    invoke-direct {v0, v1}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    goto :goto_0

    .line 235
    :pswitch_3
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f0b0011

    invoke-direct {v0, v3, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 237
    :pswitch_4
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f0b0012

    invoke-direct {v0, v3, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 239
    :pswitch_5
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    if-eqz v0, :cond_5

    .line 240
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f0b0013

    invoke-direct {v0, v3, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 242
    :cond_5
    new-instance v0, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v1, 0x7f0b0014

    invoke-direct {v0, v3, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(IIZ)V

    goto :goto_0

    .line 218
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
    .end packed-switch
.end method

.method private isAlphabetMode(I)Z
    .locals 5
    .parameter "keboardMode"

    .prologue
    .line 279
    sget-object v0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->ALPHABET_MODES:[I

    .local v0, arr$:[I
    array-length v2, v0

    .local v2, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_0
    if-ge v1, v2, :cond_1

    aget v4, v0, v1

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    .line 280
    .local v3, mode:Ljava/lang/Integer;
    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v4

    if-ne p1, v4, :cond_0

    .line 281
    const/4 v4, 0x1

    .line 284
    .end local v3           #mode:Ljava/lang/Integer;
    :goto_1
    return v4

    .line 279
    .restart local v3       #mode:Ljava/lang/Integer;
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 284
    .end local v3           #mode:Ljava/lang/Integer;
    :cond_1
    const/4 v4, 0x0

    goto :goto_1
.end method


# virtual methods
.method getKeyboardMode()I
    .locals 1

    .prologue
    .line 249
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    return v0
.end method

.method getTextMode()I
    .locals 1

    .prologue
    .line 257
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mTextMode:I

    return v0
.end method

.method getTextModeCount()I
    .locals 1

    .prologue
    .line 270
    const/4 v0, 0x2

    return v0
.end method

.method isAlphabetMode()Z
    .locals 2

    .prologue
    .line 274
    iget-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    iget v0, v1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->mKeyboardMode:I

    .line 275
    .local v0, currentMode:I
    invoke-direct {p0, v0}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->isAlphabetMode(I)Z

    move-result v1

    return v1
.end method

.method isTextMode()Z
    .locals 2

    .prologue
    const/4 v1, 0x1

    .line 253
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    if-ne v0, v1, :cond_0

    move v0, v1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method makeKeyboards(Z)V
    .locals 3
    .parameter "forceCreate"

    .prologue
    .line 109
    if-eqz p1, :cond_0

    iget-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->clear()V

    .line 113
    :cond_0
    iget-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputMethodService:Landroid/inputmethodservice/InputMethodService;

    invoke-virtual {v1}, Landroid/inputmethodservice/InputMethodService;->getMaxWidth()I

    move-result v0

    .line 114
    .local v0, displayWidth:I
    iget v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLastDisplayWidth:I

    if-ne v0, v1, :cond_1

    .line 119
    :goto_0
    return-void

    .line 115
    :cond_1
    iput v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLastDisplayWidth:I

    .line 116
    if-nez p1, :cond_2

    iget-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mKeyboards:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->clear()V

    .line 117
    :cond_2
    new-instance v1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v2, 0x7f040007

    invoke-direct {v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    iput-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 118
    new-instance v1, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    const v2, 0x7f040008

    invoke-direct {v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;-><init>(I)V

    iput-object v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    goto :goto_0
.end method

.method onKey(I)Z
    .locals 3
    .parameter "key"

    .prologue
    const/16 v2, 0x20

    const/16 v1, 0xa

    .line 325
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    packed-switch v0, :pswitch_data_0

    .line 335
    :cond_0
    :goto_0
    const/4 v0, 0x0

    :goto_1
    return v0

    .line 327
    :pswitch_0
    if-eq p1, v2, :cond_0

    if-eq p1, v1, :cond_0

    if-lez p1, :cond_0

    .line 328
    const/4 v0, 0x2

    iput v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    goto :goto_0

    .line 332
    :pswitch_1
    if-eq p1, v1, :cond_1

    if-ne p1, v2, :cond_0

    :cond_1
    const/4 v0, 0x1

    goto :goto_1

    .line 325
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method setInputView(Lcom/android/inputmethod/latin/LatinKeyboardView;)V
    .locals 0
    .parameter "inputView"

    .prologue
    .line 105
    iput-object p1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    .line 106
    return-void
.end method

.method setKeyboardMode(IIZ)V
    .locals 3
    .parameter "mode"
    .parameter "imeOptions"
    .parameter "isSupportVoiceInput"

    .prologue
    const/4 v2, 0x2

    const/4 v1, 0x1

    const/4 v0, 0x0

    .line 155
    iput v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    .line 156
    if-ne p1, v2, :cond_0

    move v0, v1

    :cond_0
    iput-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mPreferSymbols:Z

    .line 157
    if-ne p1, v2, :cond_1

    move v0, v1

    :goto_0
    iget-boolean v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mPreferSymbols:Z

    invoke-virtual {p0, v0, p2, v1, p3}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->setKeyboardMode(IIZZ)V

    .line 159
    return-void

    :cond_1
    move v0, p1

    .line 157
    goto :goto_0
.end method

.method setKeyboardMode(IIZZ)V
    .locals 5
    .parameter "mode"
    .parameter "imeOptions"
    .parameter "isSymbols"
    .parameter "isSupportVoiceInput"

    .prologue
    const/4 v4, 0x0

    .line 162
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    if-nez v2, :cond_0

    .line 186
    :goto_0
    return-void

    .line 163
    :cond_0
    iput-boolean p4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    .line 164
    iput p1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    .line 165
    iput p2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mImeOptions:I

    .line 166
    iput-boolean p3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSymbols:Z

    .line 167
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setPreviewEnabled(Z)V

    .line 168
    invoke-direct {p0, p1, p2, p3}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboardId(IIZ)Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    move-result-object v0

    .line 169
    .local v0, id:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;
    invoke-direct {p0, v0}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v1

    .line 171
    .local v1, keyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    const/4 v2, 0x3

    if-ne p1, v2, :cond_1

    .line 172
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    invoke-virtual {v2, v1}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setPhoneKeyboard(Landroid/inputmethodservice/Keyboard;)V

    .line 173
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    invoke-virtual {v2, v4}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setPreviewEnabled(Z)V

    .line 176
    :cond_1
    iput-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 177
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    invoke-virtual {v2, v1}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setKeyboard(Landroid/inputmethodservice/Keyboard;)V

    .line 178
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    iget-boolean v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSymbols:Z

    invoke-virtual {v2, v3}, Lcom/android/inputmethod/latin/LatinKeyboardView;->enableShiftKeyPreview(Z)V

    .line 182
    invoke-virtual {v1, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShifted(Z)Z

    .line 183
    invoke-virtual {v1}, Lcom/android/inputmethod/latin/LatinKeyboard;->isShiftLocked()Z

    move-result v2

    invoke-virtual {v1, v2}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShiftLocked(Z)V

    .line 184
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    iget v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    invoke-virtual {v1, v2, v3, p2}, Lcom/android/inputmethod/latin/LatinKeyboard;->setImeOptions(Landroid/content/res/Resources;II)V

    goto :goto_0
.end method

.method setLanguageSwitcher(Lcom/android/inputmethod/latin/LanguageSwitcher;)V
    .locals 2
    .parameter "languageSwitcher"

    .prologue
    const/4 v1, 0x1

    .line 99
    iput-object p1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLanguageSwitcher:Lcom/android/inputmethod/latin/LanguageSwitcher;

    .line 100
    iget-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLanguageSwitcher:Lcom/android/inputmethod/latin/LanguageSwitcher;

    invoke-virtual {v0}, Lcom/android/inputmethod/latin/LanguageSwitcher;->getInputLocale()Ljava/util/Locale;

    move-result-object v0

    iput-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputLocale:Ljava/util/Locale;

    .line 101
    iget-object v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mLanguageSwitcher:Lcom/android/inputmethod/latin/LanguageSwitcher;

    invoke-virtual {v0}, Lcom/android/inputmethod/latin/LanguageSwitcher;->getLocaleCount()I

    move-result v0

    if-le v0, v1, :cond_0

    move v0, v1

    :goto_0
    iput-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mEnableMultipleLanguages:Z

    .line 102
    return-void

    .line 101
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method setTextMode(I)V
    .locals 3
    .parameter "position"

    .prologue
    .line 261
    const/4 v0, 0x2

    if-ge p1, v0, :cond_0

    if-ltz p1, :cond_0

    .line 262
    iput p1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mTextMode:I

    .line 264
    :cond_0
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->isTextMode()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 265
    const/4 v0, 0x1

    iget v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mImeOptions:I

    iget-boolean v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    invoke-virtual {p0, v0, v1, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->setKeyboardMode(IIZ)V

    .line 267
    :cond_1
    return-void
.end method

.method toggleShift()V
    .locals 6

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 290
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    iget-object v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-virtual {v2, v3}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->equals(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 291
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {p0, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v0

    .line 292
    .local v0, symbolsKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {p0, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v1

    .line 293
    .local v1, symbolsShiftedKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    invoke-virtual {v0, v5}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShifted(Z)Z

    .line 294
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    iput-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 295
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    invoke-virtual {v2, v1}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setKeyboard(Landroid/inputmethodservice/Keyboard;)V

    .line 296
    invoke-virtual {v1, v5}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShifted(Z)Z

    .line 297
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    iget v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    iget v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mImeOptions:I

    invoke-virtual {v1, v2, v3, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setImeOptions(Landroid/content/res/Resources;II)V

    .line 307
    .end local v0           #symbolsKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    .end local v1           #symbolsShiftedKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    :cond_0
    :goto_0
    return-void

    .line 298
    :cond_1
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    iget-object v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-virtual {v2, v3}, Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;->equals(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 299
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {p0, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v0

    .line 300
    .restart local v0       #symbolsKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsShiftedId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {p0, v2}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v1

    .line 301
    .restart local v1       #symbolsShiftedKeyboard:Lcom/android/inputmethod/latin/LatinKeyboard;
    invoke-virtual {v1, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShifted(Z)Z

    .line 302
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    iput-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mCurrentId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    .line 303
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mInputView:Lcom/android/inputmethod/latin/LatinKeyboardView;

    iget-object v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsId:Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;

    invoke-direct {p0, v3}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->getKeyboard(Lcom/android/inputmethod/latin/KeyboardSwitcher$KeyboardId;)Lcom/android/inputmethod/latin/LatinKeyboard;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/android/inputmethod/latin/LatinKeyboardView;->setKeyboard(Landroid/inputmethodservice/Keyboard;)V

    .line 304
    invoke-virtual {v0, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setShifted(Z)Z

    .line 305
    iget-object v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    iget v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    iget v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mImeOptions:I

    invoke-virtual {v0, v2, v3, v4}, Lcom/android/inputmethod/latin/LatinKeyboard;->setImeOptions(Landroid/content/res/Resources;II)V

    goto :goto_0
.end method

.method toggleSymbols()V
    .locals 6

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 310
    iget v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mMode:I

    iget v1, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mImeOptions:I

    iget-boolean v2, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSymbols:Z

    if-nez v2, :cond_0

    move v2, v5

    :goto_0
    iget-boolean v3, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSupportVoiceInput:Z

    invoke-virtual {p0, v0, v1, v2, v3}, Lcom/android/inputmethod/latin/KeyboardSwitcher;->setKeyboardMode(IIZZ)V

    .line 311
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mIsSymbols:Z

    if-eqz v0, :cond_1

    iget-boolean v0, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mPreferSymbols:Z

    if-nez v0, :cond_1

    .line 312
    iput v5, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    .line 316
    :goto_1
    return-void

    :cond_0
    move v2, v4

    .line 310
    goto :goto_0

    .line 314
    :cond_1
    iput v4, p0, Lcom/android/inputmethod/latin/KeyboardSwitcher;->mSymbolsModeState:I

    goto :goto_1
.end method
